//
//  SectionAItemListDataContainer.m
//  UKListManager
//
//  Created by ET|冰琳 on 16/11/3.
//  Copyright © 2016年 UK. All rights reserved.
//

#import "UKSectionAItemListDataContainer.h"
#import "KVOArray.h"

@interface UKSectionAItemListDataContainer ()
@property (nonatomic, strong) KVOArray *actualListData;
@end

@implementation UKSectionAItemListDataContainer
@synthesize listData;

- (instancetype)init{
    if (self = [super init]) {
        self.actualListData = [KVOArray new];
        self.listData = self.actualListData.array;
    }
    return self;
}

#pragma mark - UKListDataSource
- (NSInteger)rowCountAtSection:(NSInteger)section{
    return self.listData.count > 0 ? 1 : 0;
}

- (NSInteger)sectionCount{
    return self.listData.count;
}

- (id)dataAtIndexPath:(NSIndexPath *)indexPath{
    return self.listData[indexPath.section];
}

#pragma mark - add remove
- (void)addObject:(id)item{
    [self.listData addObject:item];
}

- (void)addObjectsFromArray:(NSArray *)otherArray{
    [self.listData addObjectsFromArray:otherArray];
}

- (void)removeAll{
    [self.listData removeAllObjects];
}


@end
